home *** CD-ROM | disk | FTP | other *** search
- class classes.ui.MapScreen extends classes.ui.AbstractWidget
- {
- var hero;
- var animator;
- var next_btn;
- static var BUTTON_CLICKED = "button_clicked";
- function MapScreen()
- {
- super();
- classes.core.SoundManager.getInstance().startMusicTrack("storm_loop");
- this.doLater(this.init);
- }
- function init()
- {
- this.hero.setAnimationState("init_pos_" + classes.core.SOManager.getInstance().currentStage);
- this.animator = new classes.core.Animator([this.hero]);
- this.startLocalLoop(this.update);
- this.next_btn.addEventListener(classes.ui.TextButton.CLICK,this,"onButtonClick");
- }
- function update()
- {
- this.animator.update();
- }
- function onButtonClick(e)
- {
- var _loc0_ = null;
- if((_loc0_ = e.target) === this.next_btn)
- {
- classes.core.WidgetManager.getInstance().lockAllGlobal();
- var _loc2_ = classes.core.SOManager.getInstance().currentStage;
- this.hero.animate(["anim_" + _loc2_,"end_pos_" + _loc2_]);
- this.hero.addEventListener(classes.movieclip.AnimatedClip.COMPLETE_SEQUENCE,classes.core.Application.getInstance(),"gotoGameBoard");
- }
- }
- function dispose()
- {
- this.next_btn.dispose();
- this.animator.dispose();
- super.dispose();
- }
- }
-